/**
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 * 输入: nums = [0,1,0,3,12]
 * 输入: nums = [1,3,0,3,12]
 * 输出: [1,3,12,0,0]
 */
var moveZeroes = function (nums) {
    let left = 0, right = 0
    const len = nums.length
    while (right < len) {
        if (nums[right] === 0) {
            right++
            continue;
        }
        nums[left] = nums[right]
        left++
        right++
    }
    while (left < right) {
        nums[left] = 0
        left++
    }
};
const arr = [0, 1, 0, 3, 0]
moveZeroes(arr)
console.log(arr)